package com.ruoyi.com.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseDomain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 公共部门对象 com_department
 *
 * @author sunye
 * @date 2024-09-29
 */
@Data
public class ComDepartment extends BaseDomain
{
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "部门id")
    @TableId(value ="department_id", type = IdType.AUTO)
    private Long departmentId;

    @ApiModelProperty(value = "机构id")
    private Long deptId;

    @ApiModelProperty(value = "父部门id")
    @Excel(name = "父部门id")
    private Long parentId;

    @ApiModelProperty(value = "祖级列表")
    @Excel(name = "祖级列表")
    private String ancestors;

    @ApiModelProperty(value = "部门名称")
    @Excel(name = "部门名称")
    private String departmentName;

    @ApiModelProperty(value = "显示顺序")
    @Excel(name = "显示顺序")
    private Long orderNum;

    @ApiModelProperty(value = "部门状态")
    @Excel(name = "部门状态")
    private String status;

    @ApiModelProperty(value = "删除标志")
    private String delFlag;


    @ApiModelProperty(value = "角色列表（绑定关系使用）")
    @TableField(exist = false)
    private Long[] roleIds;



    @ApiModelProperty(value = "排序值（绑定关系使用）")
    @TableField(exist = false)
    private Long sort;


    /** 创建者 */
    private String createBy;
    /** 更新者 */
    private String updateBy;

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("departmentId", getDepartmentId())
            .append("parentId", getParentId())
            .append("ancestors", getAncestors())
            .append("departmentName", getDepartmentName())
            .append("orderNum", getOrderNum())
            .append("status", getStatus())
            .append("delFlag", getDelFlag())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
